# Maintainer: taotieren <admin@taotieren.com>

pkgname=poedit-git
pkgver=3.8.r1.g881b53b05
pkgrel=1
epoch=
pkgdesc="Translations editor for Mac, Windows and Unix"
arch=($CARCH)
url="https://github.com/vslavik/poedit"
license=('MIT')
groups=()
depends=(
    cld2
    #     cpprestsdk
    boost-libs
    gcc-libs
    glib2
    glibc
    gtk3
    gtkspell3
    hicolor-icon-theme
    icu
    lucene++
    pugixml
    wxwidgets-common
    wxwidgets-gtk3)
makedepends=(
    asciidoc
    automake
    ccache
    boost
    expat
    gettext
    git
    libjpeg-turbo
    libnotify
    libice
    libsecret
    libsm
    libtiff
    libxtst
    libxslt
    nlohmann-json
    openssl
    pkgconf
    webkit2gtk-4.1
    wxwidgets-gtk3
    xmlto
    zlib)
checkdepends=()
optdepends=()
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
replaces=()
backup=()
options=()
install=
changelog=
source=("${pkgname}::git+${url}.git")
noextract=()
sha256sums=('SKIP')
#validpgpkeys=()

pkgver() {
    cd "${srcdir}/${pkgname}"
    git describe --long --tags | sed 's/^v//g;s/.oss//g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${srcdir}/${pkgname}"

    ./bootstrap
    ./configure \
        --disable-sound \
        --prefix=/usr \
        --libexecdir=/usr/lib/poedit \
        --with-gtk=3 \
        --without-opengl \
        --with-sdl \
        --enable-webview \
        --enable-stl

    make CPPFLAGS+=' -DUCHAR_TYPE=uint16_t'
}

package() {
    cd "${srcdir}/${pkgname}"

    make DESTDIR="${pkgdir}" install
    install -Dm644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
